package com.lagou.myserver;

import com.lagou.tomcatapi.*;

import java.io.IOException;

/**
 * @author zhangxuyuan
 * @version 1.0
 * @date 2020/11/12
 */
@WebServlet(url = "/myservlet")
public class MyServlet extends HttpServlet {
    @Override public void doGet(Request request, Response response) {
        String content = "<h1>LagouServlet get</h1>";
        try {
            response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override public void doPost(Request request, Response response) {

    }

    @Override public void init() throws Exception {

    }

    @Override public void destory() throws Exception {

    }
}
